<style lang="less" scoped>
  .project-site{
    width: 100%;
    height: 100%;
    /deep/.el-table__inner-wrapper{
      height: 100% !important;
    }
    .pagination-css{
      padding: 5px;
      box-sizing: border-box;
      background-color: #fff;
      display: flex;
      justify-content: right;
      margin-top: 5px;
    }
  }
</style>

<template>
  <div class="project-site">
    <div style="width: 100%; text-align: right;">
      <el-button type="primary" @click="addSite"><el-icon><Plus /></el-icon>新增项目点</el-button>
    </div>
    <el-table :data="tableData" height="calc(100% - 76px)" :header-cell-style="{backgroundColor: '#EEF6FF'}" style="margin-top: 5px;">
      <el-table-column label="项目点编码" align="center"></el-table-column>
      <el-table-column label="项目类型" align="center"></el-table-column>
      <el-table-column label="项目点名称" align="center"></el-table-column>
      <el-table-column label="项目点归属" align="center"></el-table-column>
      <el-table-column label="操作" align="center"></el-table-column>
    </el-table>
    <el-pagination
      v-model:current-page="pageList.current"
      v-model:page-size="pageList.size"
      :page-sizes="[20, 40, 60, 80]"
      small="small"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pageList.total"
      class="pagination-css"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
    <el-dialog
      v-model="siteVisible"
      width="800px"
      :close-on-press-escape="false"
      :close-on-click-modal	="false"
    >
      <template #title>
        <span>{{ '新增项目点' }}</span>
      </template>
      <el-form :model="siteForm" inline>
        <el-form-item label="项目点编码：">
          <el-input v-model="siteForm.siteNum" placeholder="请输入项目点编码"></el-input>
        </el-form-item>
        <el-form-item label="项目点名称：">
          <el-input v-model="siteForm.siteName" placeholder="请输入项目点名称"></el-input>
        </el-form-item>
        <el-form-item label="项目类型：">
          <el-select v-model="siteForm.projectType" placeholder="请选择项目类型">
            <el-option
              v-for="(item, index) in provinceList"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="项目点归属：">
          <el-select v-model="siteForm.projectType" placeholder="请选择项目点归属">
            <el-option
              v-for="(item, index) in provinceList"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button type="" @click="bingVisible = false">取消</el-button>
        <el-button type="primary">确定</el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
      pageList: {
        current: 1,
        size: 20,
        total: 0
      },
      siteVisible: false,
      siteForm: {
        siteNum: '',
        siteName: '',
        projectType: ''
      },
      provinceList: []
    }
  },
  methods: {
    addSite() {
      this.siteVisible = true
    }
  }
}
</script>